<?php
error_reporting( E_ALL&~E_NOTICE );
ini_set( 'display_errors', 'off' );//屏蔽错误和警告提示
include("../mysql.php");
function del($tb_name){
$mysql="DELETE FROM `$tb_name` WHERE 1";
mysql_query($mysql);
echo "$tb_name 全部删除完毕";
$sql="alter table `$tb_name` AUTO_INCREMENT=1";
mysql_query($sql);  //序列号自动归1
}

function  tel_del($type){
    switch($type){
    case "悬红":
        del("xuanhongs");
        break;
    case "技能":
        del("skills");
        break;
    case "装备":
        del("equips");
        break;
    case "灯谜":
        del("dengmis");
        break;
    case "答题":
        del("questions");
        break;
    case "挖宝":
        del("wabaos");
        break;
    case "秘境":
        del("mjmaps");
        break;
    case "江湖":
        del("jhlists");
        break;
    case "地图":
        del("maps");
        break;
    case "物品":
        del("things");
        break;
    default:
        echo "类型错误，删除失败!";
}
}

if(isset($_POST['admin']) and $_POST['admin']=="dashen" and isset($_POST['type']))
{
$type = $_POST['type'];
tel_del($type);
}
else{
    echo "无权访问";
}
?>